﻿using System;
namespace LeRenard.Libraries.PlatformInspection.Inspectors
{
    /// <summary>
    /// Gets additional information on a given <see cref="Exception"/>.
    /// </summary>
    public class ExceptionInfo
    {
        /// <summary>
        /// Initializes a new <see cref="ExceptionInfo"/> object.
        /// </summary>
        /// <param name="location"></param>
        /// <param name="exception"></param>
        public ExceptionInfo(string location, Exception exception)
        {
            ThrowIf.NullOrEmpty(() => location);
            ThrowIf.Null(() => exception);

            _location = location;
            _exception = exception;
        }

        /// <summary>
        /// The exception that occured.
        /// </summary>
        public Exception Exception { get { return _exception; } }
        private readonly Exception _exception;

        /// <summary>
        /// The location where the <see cref="Exception"/> occured.
        /// </summary>
        public string Location { get { return _location; } }
        private readonly string _location;
    }
}
